import { atServer } from "kjl-miniapp-message-lite-adaptor/dist/cjs/environment-hack/server";
import { Master } from 'message-lite';

// 创建一个服务
export const server = new Master({
    createSender(event: MessageEvent) {
        return (message: any) => {
            IDP.Miniapp.view.defaultFrame.postMessage(message)
        };
    },
    listenMessage(fn) {
        IDP.Miniapp.view.defaultFrame.onMessageReceive(fn);
    },
    unListenMessage(fn) {
    },
});

atServer(server)
